import type { MenuProps } from 'antd'
import React from 'react'
type MenuItem = Required<MenuProps>['items'][number]

function getItem(
  label: React.ReactNode,
  key: React.Key,
  icon?: React.ReactNode,
  children?: MenuItem[],
  type?: 'group'
): MenuItem {
  return {
    key,
    icon,
    children,
    label,
    type
  } as MenuItem
}

const items: MenuItem[] = [
  getItem('第一个demo', '/first-demo'),
  getItem('画布的基础用法', '/canvas'),
  getItem('基础图形', '/shape'),
  getItem('文本元素', '/text'),
  getItem('图片', '/image'),
  getItem('自由绘画', '/free-drawing'),
  getItem('样式', '/styles'),
  getItem('事件', '/event'),
  getItem('导入/导出', '/importAndExport'),
  getItem('文生图', '/textToImg')
]

export { getItem, items }
